package account

import (
	"context"
	v1 "star/api/account/v1"
	"star/internal/logic/users"
)

func (c *ControllerV1) Account(ctx context.Context, req *v1.AccountReq) (res *v1.AccountRes, err error) {
	user, err := users.InfoAccount(ctx)
	if err != nil {
		return nil, err
	}

	return &v1.AccountRes{
		Username:  user.Username,
		Email:     user.Email,
		CreatedAt: user.CreatedAt,
		UpdatedAt: user.UpdatedAt,
	}, nil

}
